#define _CRT_SECURE_NO_WARNINGS 1
#include <stdio.h>
#include <string.h>
int main()
{
    char a[5000] = { 0 }, b[5000] = { 0 };
    gets(a);
    int n = strlen(a), i = 0, j = 0;
    for (i = 0; i < n; i++)
    {
        if (a[0]!=' ')
        {
            j = n - 1;
            b[j] = a[0];
            j--;
        }
        if ((a[i] != ' ' && a[i + 1] == ' ') || a[n] == '\0')
        {
            b[j] = a[i];
            j--;
        }
    }
    puts(b);

    return 0;
}